class JdbcUserRepository implements UserRepository{

    @Autowired
    JdbcTemplate jdbc;

    List<User> findByReader(String username){
        jdbc.query("SELECT id,password,email,phoneNumber,gmt_create,gmt_modify from user WHERE username=?",
        {
            rs,row ->new Book(id:rs.getString(1),
                              password:rs.getString(2),
                              email:rs.getString(3),
                              phoneNumber:rs.getString(4),
                              gmt_create:rs.getString(5),
                              gmt_modify:rs.getString(6)
                              )
        } as RowMapper,
        reader)
    }

    void save(User user){
        jdbc.update("insert into user (id,username,password,email,password,phoneNumber,gmt_create,gmt_modify)"+
        "values(?,?,?,?,?,?,?)",
        user.id,
        user.username,
        user.password,
        user.email,
        user,password,
        user.phoneNumber,
        user.gmt_create,
        user.gmt_modify)
    }
}